//
//  LazyVStackDemo.swift
//  firstFontAttrDemo
//
//  Created by liy on 2025/1/22.
//

import SwiftUI

struct LazyVStackDemo: View {
  var body: some View {
		ScrollView(.horizontal) {
      HStack {
        LazyHStack { // 超出屏幕的行销毁，所以性能不错
          ForEach(1 ..< 1000) { index in
            Text("hello world \(index)")
              .padding()
              .background(.red)
          }
        }
      }
    }
    .defaultScrollAnchor(.center)
  }
}

#Preview {
  LazyVStackDemo()
}
